


function widgets_sectionInit(domNode)
{
	jQuery(domNode).find('.widget-section-header.widget-foldable .handle')
	.click(function() {
		var section = jQuery(this).closest('.widget-section');
		section.find('.widget-section-content').eq(0).slideToggle('fast');
		section.toggleClass('widget-folded');

		if (section.hasClass('widget-persistent')) {
			var expiryDate = new Date;
			expiryDate.setMonth(expiryDate.getMonth() + 6);
			var cookiePath = '/';
			
			var cookieString = section.hasClass('widget-folded') ? '1' : '0';
			document.cookie = 'widgets_Section_' + section.attr('id') + '=' + escape(cookieString)
								+ '; expires=' + expiryDate.toGMTString()
								+ '; path=' + cookiePath;
		}
	});
	
	jQuery(domNode).find('.widget-section.widget-foldable.widget-folded .widget-section-content').hide();
}




window.bab.addInitFunction(widgets_sectionInit);
